package com.cxb.springboot.controller;

import com.cxb.springboot.domin.BidataBeneficiaryRequest;
import com.cxb.springboot.domin.EnterpriseRequest;
import com.cxb.springboot.convert.BeneficiaryRequestMapper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HelloController {

    /**
     * http://localhost:8088/
     *
     * @return
     */
    @GetMapping
    public String hello() {
        return "hello world ！";
    }

    /**
     * http://localhost:8088/jenkins
     * http://localhost:8081/mapstruct
     * @return
     */
    @GetMapping("/jenkins")
    public String jenkins() {
        return "hello jenkins ！";
    }

    @GetMapping("/mapstruct")
    public BidataBeneficiaryRequest mapstruct() {
        EnterpriseRequest request = new EnterpriseRequest();
        request.setCreditCode("123423423");
        request.setEnterpriseName("招商银行");
        request.setEnterpriseId("fdgdsgfd4353453432");
        request.setRegisterNo("324324234");
        BidataBeneficiaryRequest bidataBeneficiaryRequest = BeneficiaryRequestMapper.MAPPER.toTarget(request);
        return bidataBeneficiaryRequest;
    }
}
